local binglue = fk.CreateSkill {
  name = "mini__binglue",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["mini__binglue"] = "兵略",
  [":mini__binglue"] = "锁定技，当你发动〖飞军〗结算结束后，你摸一张牌；若为目标与你之前指定的目标均不同，改为摸两张牌。",

  ["$mini__binglue1"] = "围点打援之法，正应此时战机！",
  ["$mini__binglue2"] = "此寨久攻难下，当以避重就轻。",
}

binglue:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(binglue.name) then
      local e = player.room.logic:getCurrentEvent():findParent(GameEvent.SkillEffect)
      return e and e.data.who == player and e.data.skill.name == "feijun"
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local n = 1
    local mark = player:getTableMark(binglue.name)
    for _, move in ipairs(data) do
      if move.from ~= player and not table.contains(mark, move.from.id) then
        room:addTableMarkIfNeed(player, binglue.name, move.from.id)
        n = 2
      end
    end
    player:drawCards(n, binglue.name)
  end,
})

return binglue
